package com.whfp.coky.api.response

import android.os.Parcel
import android.os.Parcelable

/**
 * Created by 张明杨 on 2018-05-03-0003.
 * 登录实体类(获取Token)
 */
data class LoginStaffBean(
    val access_token: String?,
    val avatar: String?,
    val expires_in: Int,
    val jti: String?,
    val orgName: String?,
    val phone: String?,
    val refresh_token: String?,
    val roleName: String?,
    val roleType: String?,
    val scope: String?,
    val sex: String?,
    val token_type: String?,
    val trueName: String?
): Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(access_token)
        parcel.writeString(avatar)
        parcel.writeInt(expires_in)
        parcel.writeString(jti)
        parcel.writeString(orgName)
        parcel.writeString(phone)
        parcel.writeString(refresh_token)
        parcel.writeString(roleName)
        parcel.writeString(roleType)
        parcel.writeString(scope)
        parcel.writeString(sex)
        parcel.writeString(token_type)
        parcel.writeString(trueName)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<LoginStaffBean> {
        override fun createFromParcel(parcel: Parcel): LoginStaffBean {
            return LoginStaffBean(parcel)
        }

        override fun newArray(size: Int): Array<LoginStaffBean?> {
            return arrayOfNulls(size)
        }
    }

}
